package com.lfs.admin.util;

import com.lfs.common.utils.uuid.UUID;

import java.util.Random;

/**
 * @description: 随机数工具
 **/
public class RandomUtil {

    /**
     * @param i 生成多少位
     * @return
     */
    public static StringBuilder getRandom(int i) {
        String uuid = UUID.randomUUID().toString().replace("-", "");
        StringBuilder randomStr = new StringBuilder();
        Random random = new Random();
        for (int j = 0; j < i; j++) {
            int index = random.nextInt(uuid.length());
            randomStr.append(uuid.charAt(index));
        }
        return randomStr;
    }

}
